<template>
    <el-container>
        <el-main>
            <el-table :data="answertableData" style="width: 100%">
                <el-table-column label="编号">
                    <template slot-scope="scope">
                        <span>{{ scope.row.number }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="图纸名称">
                    <template slot-scope="scope">
                        <span>{{ scope.row.name }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="会审意见">
                    <template slot-scope="scope">
                        <span>{{ scope.row.comment }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="设计单位答疑">
                    <template slot-scope="scope">
                        <el-input type="textarea" v-model="scope.row.answer" placeholder="请输入答疑" disabled></el-input>
                    </template>
                </el-table-column>
                <el-table-column label="会审结论">
                    <template slot-scope="scope">
                        <el-input type="textarea" v-model="scope.row.result" placeholder="请输入会审结论" @blur="handleAnswer()" ></el-input>
                    </template>
                </el-table-column>
            </el-table>
        </el-main>
    </el-container>
</template>

<script>
export default {
    data() {
        return {
            answertableData: []
        };
    },
    mounted() {
        let me = this
        // console.log(this.$route.query.id);
        me.answertableData = sessionStorage.getItem('answer');
        if (me.answertableData === null || me.answertableData === undefined) {
            me.answertableData = [];
        } else {
            me.answertableData = JSON.parse(me.answertableData);
        }
        
    },
    methods: {
        handleAnswer(){
            sessionStorage.setItem("answer",JSON.stringify(this.answertableData))
        },
        handleImport(name, id) {
            console.log(name, id);
            if (name.indexOf('.rvt') >= 0) {
                console.log(true);
                this.$router.push({ path: '/other_function' });
            } else {
                console.log(false);
                this.$router.push({ path: '/drawing_examine' });
            }
        },
        handleDownload(name, id) {
            console.log(name, id);
        }
    }
};
</script>

<style scoped>
.el-main {
    background-color: #e9eef3;
    color: #333;
    text-align: center;
    height: 83vh;
    padding: 0;
}

</style>

<style>
.upload-model .el-upload.el-upload--text {
    width: auto;
    background-color: transparent;
    border: none;
    float: left;
    margin-top: 10px;
}
.upload-model .el-upload.el-upload--text button {
    border-radius: 5px;
}
.content {
    padding-right: 0 !important;
}
tr{
  font-size: 14px;
}
td{
  font-size: 13px;
}
textarea{
  padding-left: 6px!important;
}
</style>
